package com.newbsd.web.maventest.service.impl;

import com.newbsd.web.maventest.dao.OrdersDao;
import com.newbsd.web.maventest.dao.impl.OrdersImpl;
import com.newbsd.web.maventest.pojo.Order;
import com.newbsd.web.maventest.pojo.Ticket;
import com.newbsd.web.maventest.service.OrdersService;

/**  
*   
* @author ZHM
* 
*/
public class OrdersServiceImpl implements OrdersService{

	OrdersDao ordersImpl =new OrdersImpl();
	
	/**
	 * 显示将要支付的订单信息功能实现
	 */
	
	@Override
	public void getOrders(Ticket ticket) {
		
		ticket.setTickedid(ticket.getTickedid());
		ticket.setTrainno(ticket.getTrainno());
		ticket.setOrigin(ticket.getOrigin());
		ticket.setDestination(ticket.getDestination());
		ticket.setPrice(ticket.getPrice());
		//显示将要支付的订单
		ordersImpl.getOrders(ticket.getTickedid());
		
	}
	
	
	
	/**
	 * 创建订单功能实现
	 */
	@Override
	public void createOrders(Order order) {
		
		order.setPstatus(1);
		order.setCstatus(1);
		order.setCert(order.getCert());
		order.setDestination(order.getDestination());
		order.setOrigin(order.getOrigin());
		order.setPrice(order.getPrice());
		order.setTicketid(order.getTicketid());
		order.setTrainno(order.getTrainno());
		order.setUsername(order.getUsername());
		//订单表新增一条订单
		ordersImpl.createOrders(order);
	
	}



	/**
	 * 显示订单功能实现
	 */
	@Override
	public void detailOrders(Order order) {
		order.setCert(order.getCert());
		order.setCstatus(order.getCstatus());
		order.setDestination(order.getDestination());
		order.setOrderid(order.getOrderid());
		order.setOrigin(order.getOrigin());
		order.setPrice(order.getPrice());
		order.setPstatus(order.getPstatus());
		order.setTicketid(order.getTicketid());
		order.setTrainno(order.getTrainno());
		order.setUsername(order.getUsername());
		ordersImpl.detailOrders();
		
	}



	

	

}
